161 make search controls and results more compact on mobile #181
+215
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Make search controls and results more compact on mobile
Closes #161
Why
On a phone the search, sort and four filter fields came before the first result, and each result had a full-width map. At 375 px the first result started 685 px down, so only its map was on screen.
Two full results now fit on one phone screen.
What changed
Filters toggle (below 640 px)
aria-expandedandaria-controls, and its arrow flips when open. It's closed by default.checkVisibility()).Results
Files:
SearchFilters.tsx,SearchFilters.css,SightingList.css.Tests
SearchPage.test.tsx: the Filters button opens and closes the fields, and focus moves to it when the fields are hidden.e2e/mobile-search.spec.ts, at 320 px:npm run lint,npm run format:check,npm run build,npm run testandnpm run test:e2eall pass.How to check
npm run dev, then open DevTools device mode at 320 px and at 375 px.Not included
On phones the header still takes about 110 px, because "Report a sighting" wraps under the logo. That's outside this issue and could be its own task under #158.